<template>
  <el-dialog v-model="dialogVisible" title="包装方式查询" width="900px">
    <el-form class="aceauForm" label-width="120px" :model="state.form">
      <el-row :gutter="12">
        <el-col :span="12">
          <el-form-item label="包装方式编码">
            <el-input v-model="state.form.pickingBoxCode" placeholder="" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="包装方式名称">
            <el-input v-model="state.form.pickingBoxName" placeholder="" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="存货编码">
            <el-input v-model="state.form.invcode" placeholder="" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="存货名称">
            <el-input v-model="state.form.invname" placeholder="" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="query">查询</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script setup>
  import { localStorageConfig } from '@/config/localstorage.config'
  const pkCorp = localStorage.getItem(localStorageConfig.__pkCorp)
  const dialogVisible = ref(false)

  const state = reactive({
    form: {
      pkCorp: pkCorp,
    },
  })
  const openDialog = () => {
    dialogVisible.value = true
  }

  const query = () => {
    dialogVisible.value = false
    _emit('success-callback', state.form)
  }

  defineExpose({ openDialog })
  const _emit = defineEmits(['success-callback'])
</script>
